<div class="reg_login_box">
	<h1>用户注册</h1>
	<form action="<?=site_url('user/do_reg')?>" method="post" class="login_box">
		<table cellspacing="10" cellpadding="0">
			<tr>
				<th width="90">昵称:</th>
				<td><input type="text" name="username" value="" class="input5"></td>
			</tr>			
			<tr>
				<th>邮箱:</th>
				<td><input type="text" name="email" value="" class="input5"></td>
			</tr>
			<tr>
				<th>密码:</th>
				<td><input type="password" name="password" class="input5"></td>
			</tr>
			<tr>
				<th>确认密码:</th>
				<td><input type="password" name="password2" class="input5"></td>
			</tr>
			<tr>
				<th></th>
				<td>
					<input type="submit" value="注 册" class="btn1 reg_submit">
					<input type="hidden" value="<?=site_url()?>" class="direct_url">
				</td>
			</tr>
			<tr>
				<th></th>
				<td class="error"></td>
			</tr>
		</table>
	</form>
</div>

<script type="text/javascript">
	$(function() {
		$('.reg_submit').click(function() {
			$.post($('.login_box').attr('action'), $('.login_box').serialize(), function(data) {
				if(data.state != 1) {
					$('.login_box .error').removeClass('ok').html(data.msg).fadeIn("fast");
				} else {
					$('.login_box .error').addClass('ok').html(data.msg).fadeIn("fast");
					window.location.href = $('.login_box .direct_url').val();
				}
			}, 'json');
			return false;
		});
	})
</script>
